<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="./css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="./css/oweFee.css"/>
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
	</head>

	<body>
		<div class="mui-content">
			<header class="mui-bar mui-bar-nav">
				<a id="backArrear" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
				<h1 class="mui-title">详情</h1>
			</header>
			
			<div class="user-detail">
				<div class="mui-card">
					<div id="user-name" class="mui-card-header">户主</div>
					<div class="mui-card-content">
						<div class="mui-card-content-inner">
							<div class="phone-number eachInfo">
								<span class="name-title">
									手机号：
								</span>
								<span class="name-value" id="phone">
									
								</span>
							</div>
							<div class="user-id eachInfo">
								<span class="name-title">
									用户号：
								</span>
								<span class="name-value" id="userid">
									
								</span>
							</div>
							<div class="water-id eachInfo">
								<span class="name-title">
									水表号：
								</span>
								<span class="name-value" id="waterid">
									
								</span>
							</div>
							<div class="default-money eachInfo">
								<span class="name-title">
									违约金：
								</span>
								<span class="name-value" id="defaultMoney">
									
								</span>
							</div>
							<div class="extra-charge eachInfo">
								<span class="name-title">
									附加费：
								</span>
								<span class="name-value" id="extraCharge">
									
								</span>
							</div>
							<div class="garbage-fee eachInfo">
								<span class="name-title">
									垃圾处理费：
								</span>
								<span class="name-value" id="garbageFee">
									
								</span>
							</div>
							<div class="water-fee eachInfo">
								<span class="name-title">
									水费：
								</span>
								<span class="name-value" id="waterFee">
									
								</span>
							</div>
							<div class="last-month-code eachInfo">
								<span class="name-title">
									上月抄码：
								</span>
								<span class="name-value" id="lastMonthCode">
									
								</span>
							</div>
							<div class="this-month-code eachInfo">
								<span class="name-title">
									本月抄码：
								</span>
								<span class="name-value" id="thisMonthCode">
									
								</span>
							</div>
							<div class="m-tonnage eachInfo">
								<span class="name-title">
									用水吨位：
								</span>
								<span class="name-value" id="mTonnage">
									
								</span>
							</div>
							<div class="oweFee-time eachInfo">
								<span class="name-title">
									欠费年月：
								</span>
								<span class="name-value" id="oweFeeTime">
									
								</span>
							</div>
							<div class="total-money eachInfo">
								<span class="name-title">
									总欠费：
								</span>
								<span class="name-value total-money-value" id="totalMoney">
									
								</span>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<script src="./js/mui.min.js"></script>
		<script src="js/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/Mobile.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init()
			window.onload = function(){
				mui.plusReady(function () {
					var self = plus.webview.currentWebview();
					var glbToken = self.token; 
					var userid = self.userid;
					var userName = self.userName;
					var wrsid = self.wrsid;
					var topSec = self.topSec;
					if (checkToken(glbToken).status == "ok") {
						var oweFee = getOwefee(userid, topSec, glbToken).rows;
						for (var i = 0; i < oweFee.length; i++) {
							if (oweFee[i].WRSID == wrsid) {
								// 显示详情信息
								document.getElementById('user-name').innerText = userName;
								$('#phone').text(oweFee[i].Phone);
								$('#userid').text(userid);
								$('#waterid').text(oweFee[i].WaterID);
								$('#defaultMoney').text(oweFee[i].DefaultMoney + '元');
								$('#extraCharge').text(oweFee[i].ExtraCharge + '元');
								$('#garbageFee').text(oweFee[i].GarbageFee + '元');
								$('#waterFee').text(oweFee[i].WaterFee + '元');
								$('#lastMonthCode').text(oweFee[i].LastMonthCode);
								$('#thisMonthCode').text(oweFee[i].ThisMonthCode);
								$('#mTonnage').text(oweFee[i].MeatureTonnage + '吨');
								$('#totalMoney').text(oweFee[i].TotalMoney + '元');
								$('#oweFeeTime').text(oweFee[i].ReadCodeDate)
								break
							}
						}
					}else {
						app.setState({});
						plus.webview.getLaunchWebview().show("pop-in");
						setTimeout(function() {
							alert("此账号已在其他设备登录,请重新登录!");
							localStorage.clear();
							plus.runtime.restart();
						}, 30);
					}
				})
			}
		</script>
	</body>

</html>
